﻿using System;
using System.Windows.Controls;
using System.Windows.Navigation;
using EzDesk.DesktopClient.UtilityView.ViewContract;
using EzDesk.DesktopClient.UtilityView.ViewModel;
using EzDesk.Generic;
using EzDesk.MVVMBase;

namespace EzDesk.DesktopClient.UtilityView.View
{
    /// <summary>
    /// Interaction logic for UpdateItemView.xaml
    /// </summary>
    public partial class UpdateItemView : UserControl, IUpdateItemView
    {
        public UpdateItemView()
        {
            InitializeComponent();
        }
        private void ContentControl_RequestNavigate(object sender, RequestNavigateEventArgs e)
        {
            //OnNavigate.ExecuteMethod(null, "http://localhost:2604/Test.aspx");
            OnNavigate.ExecuteMethod(null, e.Uri.AbsoluteUri);
        }

        #region IFeedItemView Members

        public event EventHandler<Generic.GenericEventArg<string>> OnNavigate;

        #endregion

        #region IView Members

        #endregion

        private void userControl_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            ViewModel.SetFeedReadCommand.Execute();
        }

        public IUpdateItemViewModel ViewModel
        {
            get { return DataContext as IUpdateItemViewModel; }
            set { DataContext = value; }
        }

        object IView.ViewModel
        {
            get { return DataContext; }
            set { DataContext = value; }
        }
    }
}
